<div class="db_left bl">
    <?php $this->load->view('medical/object/side_block'); ?>
</div>
    <div class="db_right bl">
        <div class="std_header auto_height">
            <div class="left">
                <strong>Thông tin triệu chứng lâm sàng</strong>
            </div>
        </div>
        <div id="symptoms_management">
            <form id="frm_symptoms_edit" enctype="multipart/form-data" method="POST" action="<?php echo $save_action; ?>">
                <?php $this->load->view('medical/symptoms/message'); ?>
                <input id="entity_id" type="hidden" name="id" value="<?php echo isset($symptoms->id) ? $symptoms->id : '' ; ?>" />
                <div class="clearfix auto_height mb_10 mt_10">
                    <button class="gray_btn " type="button" onclick="window.location = '<?php echo site_url('admin/medical/symptoms/index', true); ?>'"><span>Về danh sách</span></button>
                    <button class="gray_btn" type="submit" ><span>Lưu lại</span></button>
                    <button class="gray_btn" type="reset"><span>Nhập lại</span></button>
                    <?php if (isset($symptoms->id) && $has_privilege_delete) :?>
                    <button class="gray_btn delete_btn" type="button" action="<?php echo site_url('admin/medical/symptoms/delete/id/' . $symptoms->id, true); ?>" message="Bạn muốn xóa khoa này?" onclick="btn_util.active_delete(this)"><span>Xóa khoa</span></button>
                    <?php endif; ?>
                </div>
                <div class="form_block">
                    <div class="block_header">
                        Thông tin cơ bản
                    </div>
                    <div class="block_content">
                        <table cellpadding="0px" cellspacing="0px">
                            <tr>
                                <td class="frm_label">Triệu chứng(*)</td>
                                <td class="frm_field">
                                    <input type="text" class="std_input required" name="data[name]" title="Tên bộ phận cơ thể không được để trống" value="<?php echo get_field($symptoms, 'name'); ?>" />
                                </td>
                            </tr>
                            <tr>
                                <td class="frm_label">Triệu chứng khác</td>
                                <td class="frm_field">
                                    <input type="text" class="std_input" title="Bí danh" name="data[alter_name]"  value="<?php echo get_field($symptoms, 'alter_name'); ?>" />
                                </td>
                            </tr>
                            <tr>
                                <td class="frm_label">Thuộc bộ phận cơ thể</td>
                                <td class="frm_field">
                                    <select name="data[parts_id]" id="parts_id">

                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td class="frm_label">Mức độ phổ biến</td>
                                <td class="frm_field">
                                    <input type="text" class="std_input" title="Bí danh" name="data[system_score]"  value="<?php echo get_field($symptoms, 'system_score'); ?>" />
                                </td>
                            </tr>
                            <tr>
                                <td class="frm_label">Ảnh minh họa</td>
                                <td class="frm_field">
                                    <?php $image = get_field($symptoms, 'image'); ?>
                                    <?php if (!empty($image)) :?>
                                    <a target="_blank" href="<?php echo render_src($image); ?>"><img src="<?php echo render_src($image); ?>" width="40px" style="vertical-align: middle; border: 2px solid #bbb" /></a>
                                    <?php endif; ?>
                                    <input type="file" name="data_image" />
                                    &nbsp;
                                    <input onclick="return admin_medical_parts.show_img_path(this.checked)" style="top: 2px; position: relative" type="checkbox" name="set_img_url" id="set_img_url" value="1" />
                                    <label for="set_img_url">Chọn đường dẫn ảnh</label>
                                    <div class="clearfix mt_10" id="wp_img_path" style="display: none">
                                        <input name="img_path" type="text" class="std_input" value="<?php echo $image; ?>" />
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="frm_label">Mô tả chi tiết</td>
                                <td class="frm_field">
                                    <textarea rows="" cols="" name="data[description]" title="Mô tả ngắn"><?php echo get_field($symptoms, 'description'); ?></textarea>
                                </td>
                            </tr>
                            <tr>
                                <td class="frm_label">Hiển thị</td>
                                <td class="frm_field">
                                    <select class="std_input" name="data[is_hidden]">
                                        <option value="1" <?php if (isset($symptoms->is_hidden) && $symptoms->is_hidden == 1) :?> selected="selected" <?php endif; ?>>Hiện</option>
                                        <option value="2" <?php if (isset($symptoms->is_hidden) && $symptoms->is_hidden == 2) :?> selected="selected" <?php endif; ?>>Ẩn</option>
                                    </select>
                                </td>
                            </tr>

                        </table>
                    </div>
                </div>
                <div class="form_block">
                    <div class="block_header">
                        Thông tin SEO
                    </div>
                    <div class="block_content">
                        <table cellpadding="0px" cellspacing="0px">
                            <tr>
                                <td class="frm_label">Tiêu đề(*)</td>
                                <td class="frm_field">
                                    <input type="text" class="std_input" name="data[meta_title]" value="<?php echo get_field($symptoms, 'meta_title'); ?>" />
                                </td>
                            </tr>
                            <tr>
                                <td class="frm_label">Từ khóa(*)</td>
                                <td class="frm_field">
                                    <input type="text" class="std_input" name="data[meta_keywords]" value="<?php echo get_field($symptoms, 'meta_keywords'); ?>" />
                                </td>
                            </tr>
                            <tr>
                                <td class="frm_label">Mô tả(*)</td>
                                <td class="frm_field">
                                    <textarea class="std_editor"  name="data[meta_description]"><?php echo get_field($symptoms, 'meta_description'); ?></textarea>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="clearfix auto_height mb_10">
                    <button class="gray_btn " type="button" onclick="window.location = '<?php echo site_url('admin/medical/symptoms/index', true); ?>'"><span>Về danh sách</span></button>
                    <button class="gray_btn" type="submit" ><span>Lưu lại</span></button>
                    <button class="gray_btn" type="reset"><span>Nhập lại</span></button>
                    <?php if (isset($symptoms->id) && $has_privilege_delete) :?>
                    <button class="gray_btn delete_btn" type="button" action="<?php echo site_url('admin/medical/symptoms/delete/id/' . $symptoms->id, true); ?>" message="Bạn muốn xóa khoa này?" onclick="btn_util.active_delete(this)"><span>Xóa khoa</span></button>
                    <?php endif; ?>
                </div>
            </form>
        </div>
    </div>


<div class="clearfix"></div>
<script type="text/javascript" src="<?php echo BASE_URL; ?>js/admin/medical/object/function.js"></script>
<script type="text/javascript">
    var allParts = <?php echo $list_parts;?>;//lấy hết bộ phận cơ thẻ
    var partsId = '<?php echo get_field($symptoms, 'parts_id'); ?>';

    $("#frm_symptoms_edit").validate({
        errorLabelContainer: $("#form_error")
    });

    admin_medical_parts.showOptParts(allParts, 'parts_id', partsId);

</script>
